public class Test1 {
    public String solve (String s, String t) {
        // write code here
        int tmp = 0;
        char[] ss = s.toCharArray();
        char[] tt = t.toCharArray();
        int index1 = ss.length-1;
        int index2 = tt.length-1;
        StringBuilder ret = new StringBuilder();
        while (index1 >= 0 || index2 >= 0 || tmp != 0) {
            int num1 = index1 >= 0 ? ss[index1] - '0' : 0;
            int num2 = index2 >= 0 ? tt[index2] - '0' : 0;
            int sum = num1 + num2 + tmp;
            ret.append(sum % 10);
            tmp = sum / 10;
            index1--;
            index2--;
        }
        return ret.reverse().toString();
    }

    public static void main(String[] args) {
        Test1 t = new Test1();
        String s = t.solve("1", "99");
    }
}
